]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Disconnect from window signal handlers when removing a window
authorColin Walters <walters@verbum.org>
Tue, 20 Oct 2009 21:43:51 +0000 (17:43 -0400)
committerColin Walters <walters@verbum.org>
Wed, 21 Oct 2009 15:44:07 +0000 (11:44 -0400)
We need to remove all of our signal handlers attached to a window
when being disposed.

https://bugzilla.gnome.org/show_bug.cgi?id=598502

src/shell-app.c

index ac0cf5692fd8f3fce708300013b8521d70f7801b..e89fcbee595c0d20a527819ea4842646295d21b0 100644 (file)
@@ -324,8 +324,11 @@ void
 _shell_app_remove_window (ShellApp   *app,
                           MetaWindow *window)
 {
+  g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_unmanaged), app);
+  g_signal_handlers_disconnect_by_func (window, G_CALLBACK(shell_app_on_user_time_changed), app);
   g_object_unref (window);
   app->windows = g_slist_remove (app->windows, window);
+
   if (app->windows == NULL)
     disconnect_workspace_switch (app);
 }
@@ -346,12 +349,8 @@ shell_app_dispose (GObject *object)
       app->info = NULL;
     }
 
-  if (app->windows)
-    {
-      g_slist_foreach (app->windows, (GFunc) g_object_unref, NULL);
-      g_slist_free (app->windows);
-      app->windows = NULL;
-    }
+  while (app->windows)
+    _shell_app_remove_window (app, app->windows->data);
 
   disconnect_workspace_switch (app);
 }